#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol XMAudioPlayerDelegate <NSObject>
@optional
- (void)playerPlaying:(NSTimeInterval)curTime duration:(NSTimeInterval)duration;
- (void)playerDidFinishPlaying:(AVAudioPlayer *)player flag:(BOOL)flag;
@end


@interface XMAudioPlayer : NSObject
@property (nonatomic, weak) id<XMAudioPlayerDelegate> delegate;
+ (XMAudioPlayer *)sharedInstance;
- (void)startPlayVoiceData:(NSData *)data time:(float)time;
- (void)pausePlay;
- (void)stopPlay;
- (BOOL)isPlaying;
- (float)curTime;
- (float)duration;
@end
NS_ASSUME_NONNULL_END
